package edu.uniquindio.prmaven.proyectofinal;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import edu.uniquindio.prmaven.general.TestCore;

public class DropdownError extends TestCore {
	
	@Test()
	/**
	dataProviderClass = edu.uniquindio.prmaven.dataprovider.DataProviderFactory.class, 
	dataProvider = ConfigurationConstants.DP_FACTORY
	@DataProviderArguments(ConfigurationConstants.ESCENARIO
			+ ConfigurationConstants.EQUALS + DataProvidersConstants.HOJA_1)
			**/
	public void TestDropdownError() throws Exception {
		
		try {
			selenium.open("/showcase/");
			
			//selenium.click("css=span.MainLinkText"); Seleccionar menu Ajax Core
			WebElement menu=driver.findElement(By.cssSelector("span.MainLinkText"));
			menu.click();
		
			//Seleccionar  submenu Dropdown
			WebElement Dropdown = driver.findElement(By.xpath("//*[@id='MENUSIDEindent']/div[2]/a[7]"));
			Dropdown.click();
			
			selenium.waitForPageToLoad("30000");
			
						
			//Click Submit //*[@id='j_idt87:j_idt97']
			WebElement botonGrabar= driver.findElement(By.xpath("//*[@id='j_idt87:j_idt97']"));
			botonGrabar.click();

			//Verificar mensaje 
			Assert.assertEquals(selenium.getText("css=p"), "City is not selected.");
			
			selenium.waitForPageToLoad("5000");
		
		}catch(AssertionError e){
			System.out.println("no se encontro texto");
		}finally{
			
		}
	}

	}
